<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <style>
    div {
      margin-top: 180px;
      text-align: center;
    }
    .p1 {
      border: none;
    }

    [type='range'] {
      -webkit-appearance: none;
      appearance: none;
      margin: 0;
      outline: 0;
      background-color: transparent;
      height: 20px;
      width: 500px;
    }

    [type='range']::-webkit-slider-runnable-track {
      height: 4px;
      background: #eee;
    }

    [type='range' i]::-webkit-slider-container {
      height: 20px;
      overflow: hidden;
    }

    [type='range']::-webkit-slider-thumb {
      -webkit-appearance: none;
      appearance: none;
      width: 20px;
      height: 20px;
      border-radius: 50%;
      background-color: #f44336;
      border: 1px solid transparent;
      margin-top: -8px;
      border-image: linear-gradient(#f44336, #f44336) 0 fill / 8 20 8 0 / 0px 0px 0 2000px;
    }
  </style>
</head>

<body>
  <div>
    <!-- 分数 -->
    <p>分数为：<input class="p1" type="text"></p>
    <!-- 滑槽 -->
    <input class="p2" type="range" value="20">
  </div>
  <script>
    const score = document.querySelector('.p1');
    const p2 = document.querySelector('.p2');

    score.value = 20+'分'
    p2.addEventListener('change', function () {
      score.value = p2.value+'分'
      score.innerHTML = score.value
    })

  </script>
</body>

</html>